package com.lzw.okgoutils.http.otherutils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 * 日期工具类
 */
public class DateUtil {

    public static String getFormatDateTime() {
        Date date = new Date();
        return formatDate(date,"yyyy-MM-dd HH:mm:ss");
    }

    public static String formatDate(Date date, String format){
        if(date == null){
            return  "";
        }
        SimpleDateFormat sFormat = new SimpleDateFormat(format, Locale.CHINA);
        return sFormat.format(date);
    }
}
